package com.ccp.dev.workflow.model;

import com.ccp.dev.core.basic.model.BaseModel;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * 对象功能:联动设置表 Model对象 
 * @author fanruiqi
 */
@SuppressWarnings("serial")
@XmlRootElement(name = "bpmGangedSet")
@XmlAccessorType(XmlAccessType.NONE)
public class BpmGangedSet extends BaseModel<BpmGangedSet> {
	/**
	 * 开始节点ID
	 */
	public static final String START_NODEID = "1";
	public static final String ALL_NODEID = "2";

	// 主键
	@XmlAttribute
	protected String id;
	// 流程定义ID
	@XmlAttribute
	protected String modelId;
	// 流程节点ID
	@XmlAttribute
	protected String nodeId;
	// 流程节点名称
	@XmlAttribute
	protected String nodeName;
	// 选择框字段设置
	@XmlAttribute
	protected String chooseField;
	// 变更字段设置
	@XmlAttribute
	protected String changeField;

	public void setId(String id) {
		this.id = id;
	}

	/**
	 * 返回 主键
	 * 
	 * @return
	 */
	public String getId() {
		return this.id;
	}

	public void setModelId(String modelId) {
		this.modelId = modelId;
	}

	/**
	 * 返回 流程定义ID
	 * 
	 * @return
	 */
	public String getModelId() {
		return this.modelId;
	}

	public void setNodeId(String nodeId) {
		this.nodeId = nodeId;
	}

	/**
	 * 返回 流程节点ID
	 * 
	 * @return
	 */
	public String getNodeId() {
		return this.nodeId;
	}

	public void setNodeName(String nodeName) {
		this.nodeName = nodeName;
	}

	/**
	 * 返回 流程节点名称
	 * 
	 * @return
	 */
	public String getNodeName() {
		return this.nodeName;
	}

	public void setChooseField(String chooseField) {
		this.chooseField = chooseField;
	}

	/**
	 * 返回 选择框字段设置
	 * 
	 * @return
	 */
	public String getChooseField() {
		return this.chooseField;
	}

	public void setChangeField(String changeField) {
		this.changeField = changeField;
	}

	/**
	 * 返回 变更字段设置
	 * 
	 * @return
	 */
	public String getChangeField() {
		return this.changeField;
	}

	/**
	 * @see Object#equals(Object)
	 */
	@Override
    public boolean equals(Object object) {
		if (!(object instanceof BpmGangedSet)) {
			return false;
		}
		BpmGangedSet rhs = (BpmGangedSet) object;
		return new EqualsBuilder().append(this.id, rhs.id)
				.append(this.modelId, rhs.modelId).append(this.nodeId, rhs.nodeId)
				.append(this.nodeName, rhs.nodeName)
				.append(this.chooseField, rhs.chooseField)
				.append(this.changeField, rhs.changeField).isEquals();
	}

	/**
	 * @see Object#hashCode()
	 */
	@Override
    public int hashCode() {
		return new HashCodeBuilder(-82280557, -700257973).append(this.id)
				.append(this.modelId).append(this.nodeId).append(this.nodeName)
				.append(this.chooseField).append(this.changeField).toHashCode();
	}

	/**
	 * @see Object#toString()
	 */
	@Override
    public String toString() {
		return new ToStringBuilder(this).append("id", this.id)
				.append("modelId", this.modelId).append("nodeId", this.nodeId)
				.append("nodeName", this.nodeName)
				.append("chooseField", this.chooseField)
				.append("changeField", this.changeField).toString();
	}

}